home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 February / EnigmA AMIGA RUN 04 (1996)(G.R. Edizioni)(IT)[!][issue 1996-02][Skylink CD III].iso / earcd / util1 / ultmtpch.lha / UPS / Sources / ups.h < prev    next >
C/C++ Source or Header  |  1995-09-23  |  15KB  |  356 lines

  1. #ifndef UPS_H
  2. #define UPS_H
  3. /*
  4. **  $VER: ups.h 39.1 (05.07.95)
  5. **
  6. **  Structures and constants for Ultimate Patch System.
  7. **
  8. **  (C) Copyright 1994-1995 Glenz Points.
  9. **      All Rights Reserved
  10. */
  11.  
  12. #ifndef EXEC_TYPES_H
  13. #include <exec/types.h>
  14. #endif
  15.  
  16. #ifndef EXEC_PORTS_H
  17. #include <exec/ports.h>
  18. #endif
  19.  
  20.  
  21.  
  22. /**
  23. ***  Version strcuture
  24. **/
  25.  
  26. struct PVS {
  27.   WORD        PVS_Version;              /// version word
  28.   BYTE        PVS_Revision;             /// revision byte
  29.   BYTE        PVS_User1;                ///
  30. };
  31.  
  32.  
  33.  
  34.  
  35. /**
  36. ***  Patcher file structure
  37. **/
  38.  
  39. struct pfs {
  40.   LONG        pfs_code[8];              /// 32 bytes of code
  41.   LONG        pfs_ControlLong;          /// must be equal to ControlLong
  42.   struct pfs *pfs_Next;                 /// pointer to next patcher
  43.   struct pfs *pfs_Prev;                 /// pointer to prev patcher
  44.   struct PVS  pfs_NeedVersion;          /// minimum version of UPS to start
  45.   struct PVS  pfs_UsedVersion;          /// version of UPS which was used
  46.                                         /// while patcher was developed
  47.   APTR        pfs_PatcherName;          /// pointer to name of patcher
  48.   struct PVS  pfs_Version;              /// version
  49.   APTR        pfs_CoderName;            /// pointer to name of programmer
  50.   APTR        pfs_VersionString;        /// pointer to $VER: string
  51.   APTR        pfs_PatcherIDString;      /// listview entry
  52.   LONG        pfs_Flags;                /// flags
  53.   LONG        pfs_Status;               /// status of flags
  54.   APTR        pfs_ExecBase;             /// exec base
  55.   APTR        pfs_IntBase;              /// intuition base
  56.   APTR        pfs_GadTBase;             /// gadtools base
  57.   APTR        pfs_DosBase;              /// dos base
  58.   APTR        pfs_GfxBase;              /// graphics base
  59.   APTR        pfs_CxBase;               /// commodities base
  60.   APTR        pfs_LayBase;              /// layers base
  61.   APTR        pfs_UPSBase;              /// UPS lib base
  62.   APTR        pfs_Init;                 /// pointer to init routine
  63.   APTR        pfs_Exit;                 /// pointer to exit routine
  64.   APTR        pfs_Prefs;                /// pointer to prefs routine
  65.   APTR        pfs_PrefsKey;             /// pointer to cx keys to call
  66.                                         /// prefs rout
  67.   struct orl *pfs_ListPtr;              /// pointer to struct of requested
  68.                                         /// opened resources
  69.   struct mps *pfs_Patch;                /// pointer to struct for patches
  70.   struct pls *pfs_pls;            /// pointer to pls structure
  71.   APTR        pfs_UPSMsgPort;           /// pointer to main UPS msg port
  72.   APTR        pfs_UPSRexxPort;          /// pointer to rexx port
  73.   struct pxs *pfs_pxs;                  /// pointer to pxs structure
  74.   BOOL       *pfs_fakesemaphore;        /// TRUE for UPS's setfunction
  75.   LONG        pfs_User1;                ///
  76.   LONG        pfs_User2;                ///
  77.   LONG        pfs_ControlLong2;         /// ControlLong
  78.   struct pfs *pfs_PFS;                  /// pointer to the beginning of struct
  79. };
  80.  
  81.  
  82. #define pfsControlLong  0x17061995
  83. #define UPSMainVersion  39
  84. #define UPSMainRevision 0
  85. #define pfsPatcherStringLen   25
  86. #define pfsPatchLinkStringLen 27
  87. #define pfsPatcherStartupLen  31
  88. #define pfsOffsetLen          26
  89. #define pfsStartupCycleLen    29
  90. #define pfsLibOverviewLen     38
  91. #define pfsPMListviewLen      16
  92. #define pfsOldNewLen           9
  93. #define pfsPurposeLen         16
  94. #define pfsLOPatcherStrLen    16
  95.  
  96.  
  97. #define pfsDisableable  0x00000001      /// Enable disable patcher option
  98. #define pfsPrefs        0x00000002      /// Prefs editor exists
  99. #define pfsNoRemoveable 0x00000004      /// Disable Removing of Patcher
  100.  
  101.  
  102. /**
  103. ***  Patcher Extended Structure
  104. **/
  105.  
  106. struct pxs {
  107.   LONG        pxs_CxID;                 /// Commodity hotkey id
  108.   APTR        pxs_CxObjs;               /// Commodity object pointer
  109. };
  110.  
  111.  
  112. /**
  113. ***  Open resource List
  114. **/
  115.  
  116. struct orl {
  117.   struct orl *orl_Next;                 /// pointer to next entry
  118.   struct orl *orl_Prev;                 /// pointer to previous entry
  119.   LONG        orl_Type;                 /// type of resource
  120.   LONG        orl_ID;                   /// resource id
  121.   LONG        orl_Flags;                /// flags
  122.   APTR        orl_Name;                 /// pointer to name of resource
  123.   APTR        orl_Base;                 /// base of opened resource
  124.   LONG        orl_Version;              /// version, if needed
  125.   LONG        orl_DataRegs[8];          /// ...to put in data regs
  126.   APTR        orl_Open;                 /// user open rout for user type
  127.   APTR        orl_Close;                /// user close rout for user type
  128.   APTR        orl_UTName;               /// pointer to name for user type
  129.   LONG        orl_User1;                ///
  130.   LONG        orl_User2;                ///
  131. };
  132.  
  133. #define orlNoNecessary     0x00000001   /// dont care if not opened
  134.  
  135. #define rt_Library         1            /// resource type is library
  136. #define rt_TrapVector      2            /// resource type is trap vector
  137. #define rt_Device          3            /// resource type is device
  138. #define rt_Handler         4            /// resource type is handler
  139. #define rt_Resource        5            /// resource type is resource
  140. #define rt_DataType        6            /// resource type is datatype
  141. #define rt_User1        1024            /// User type. Needs user open/close
  142. #define rt_User2        1025
  143. #define rt_User3        1026
  144. #define rt_User4        1027
  145. #define rt_User5        1028
  146. #define rt_User6        1029
  147. #define rt_User7        1030
  148. #define rt_User8        1031
  149.  
  150.  
  151.  
  152. /**
  153. ***  Main patch struct
  154. **/
  155.  
  156. struct mps {
  157.   struct mps *mps_Next;                 /// pointer to next patch
  158.   struct mps *mps_Prev;                 /// pointer to prev patch
  159.   LONG        mps_Pri;                  /// priority, less runs first
  160.   struct pfs *mps_Patcher;              /// pointer to parent Patcher
  161.   APTR        mps_PatchIDString;        /// listview entry
  162.   APTR        mps_PurposeString;        /// pointer to purpose string
  163.   LONG        mps_ID;                   /// id of resource to be patched
  164.   LONG        mps_Flags;                /// flags
  165.   LONG        mps_Status;               /// status of flags
  166.   LONG        mps_Offset;               /// offset to change
  167.   APTR        mps_New;                  /// pointer to new routine
  168.   APTR        mps_Old;                  /// pointer to old routine
  169.   struct pns *mps_pns;                  /// pointer to pns structure
  170.   APTR        mps_NotifyDisable;        /// notified when enabled/disabled
  171.   APTR        mps_Install;              /// install rout for user type
  172.   APTR        mps_Remove;               /// uninstall rout for user type
  173.   APTR        mps_Init;                 /// pointer to init routine
  174.   APTR        mps_Exit;                 /// pointer to exit routine
  175.   struct pls *mps_pls;                  /// pointer to pls structure
  176.   LONG        mps_User1;                ///
  177.   LONG        mps_User2;                ///
  178.   LONG        mps_User3;                ///
  179.   LONG        mps_User4;                ///
  180. };
  181.  
  182.  
  183. #define mpsIDStringLen  27
  184.  
  185. #define mpsDisableable  0x00000001      /// Enable disable patch option
  186. #define mpsFullPatch    0x00000002      /// if full, don't call orig. patch
  187. #define mpsDisTemp      0x00000004      /// While removed, previous status
  188.  
  189.  
  190.  
  191. /**
  192. ***  Patch node struct
  193. **/
  194.  
  195. struct pns {
  196.   WORD        pns_Jsr;                  /// jsr ($4eb9)
  197.   APTR        pns_New;                  /// newrout
  198.   WORD        pns_Jmp;                  /// jmp ($4ef9)
  199.   struct pns *pns_Next;                 /// nextrout
  200.   struct pns *pns_Prev;                 /// pointer to prev node
  201.   LONG        pns_Pri;                  /// pri, less first
  202.   APTR        pns_Orig;                 /// orginal routine
  203.   struct mps *pns_Patch;                /// pointer to main patch
  204.   struct pfs *pns_Patcher;              /// pointer to patcher
  205.   LONG        pns_Mark;                 /// $fc263815
  206.   struct pns *pns_pns;                  /// pointer to this structure
  207.   LONG        pns_User1;                ///
  208.   LONG        pns_User2;                ///
  209. };
  210.  
  211.  
  212.  
  213. /**
  214. ***  UPS message
  215. **/
  216.  
  217. struct um {
  218.   struct Message
  219.               um_Message;
  220.   LONG        um_Command;               /// command to execute
  221.   LONG        um_A0;                    /// adress register 0
  222.   LONG        um_A1;                    /// adress register 1
  223.   LONG        um_A2;                    /// adress register 2
  224.   LONG        um_A3;                    /// adress register 3
  225.   LONG        um_D0;                    /// data register 0
  226.   LONG        um_D1;                    /// data register 1
  227.   LONG        um_D2;                    /// data register 2
  228.   LONG        um_D3;                    /// data register 3
  229. };
  230.  
  231. #define umAllocUPS      0x00000001      /// Allocate UPS, in a0 ptr to
  232.                                         /// app name
  233. #define umFreeUPS       0x00000002      /// Free UPS, in a0 ptr to app
  234.                                         /// name
  235. #define umLoadPatcher   0x00000010      /// Initiate LoadPatcher routine
  236. #define umAddPatcher    0x00000015      /// Load Patcher, in a0 ptr to
  237.                                         /// filename, in d0 error code
  238. #define umInstall       0x00000030      /// Install Patcher, in a0 ptr to
  239.                                         /// patcher, in d0 error code
  240. #define umRemove        0x00000031      /// Remove Patcher, in a0 ptr to
  241.                                         /// patcher
  242. #define umOpenResource  0x00000050      /// Open Resource, in a0 ptr to
  243.                                         /// resource, in d0 return BOOL.
  244. #define umCloseResource 0x00000051      /// Close Resource, in a0 ptr to
  245.                                         /// resource
  246. #define umInstallPatch  0x00000040      /// Install Patch, in a0 ptr to
  247.                                         /// patch, in d0 error code
  248. #define umRemovePatch   0x00000041      /// Remove Patch, in a0 ptr to
  249.                                         /// patch
  250. #define umEnablePatcher 0x00000035      /// Enable patcher in a0
  251. #define umDisablePatcher 0x00000036     /// Disable patcher in a0
  252. #define umEnablePLink   0x00000037      /// Enadle patch link in a0
  253. #define umDisablePLink  0x00000038      /// Disable patch link in a0
  254. #define umOpenMain      0x00000060      /// Open Main Window
  255. #define umCloseMain     0x0000006f      /// Close Main Window
  256. #define umOpenPM        0x00000061      /// Open Patcher Manager Window
  257. #define umClosePM       0x0000006e      /// Close Patcher Man. Window
  258. #define umOpenLO        0x00000062      /// Open Library Overview Window
  259. #define umCloseLO       0x0000006d      /// Close Lib. Overview Window
  260. #define umSpitRequester 0x00000070      /// Spit requester, with text in
  261.                                         /// a0
  262. #define umPrint         0x00000073      /// Print text line in a0
  263. #define umPrefsPatcher  0x00000078      /// Call prefs from Patcher in a0
  264. #define umPrefsPatchL   0x0000007a      /// Call prefs from PatchList in
  265.                                         /// a0
  266. #define umGetLibBase    0x00000008      /// Get base ptr from code in d0,
  267.                                         /// result in a0
  268. #define umGetPList      0x0000000a      /// Get PList ptr in a0, and
  269.                                         /// PList itself in d0/d1/d2
  270. #define umMakeEasyPatcher 0x0000001c    /// Make easy patcher with
  271.                                         /// tagarray in a0. Pointer in
  272.                                         /// a0, or null for error
  273. #define umFreeEasyPatcher 0x0000001d    /// Remove easy patcher in a0.
  274. #define umMakeEasyPatch 0x0000001e      /// Add Patch to easy patcher.
  275.                                         /// Pointer to tagarray in a0,
  276.                                         /// and parent patcher in a1.
  277.                                         /// Pointer to patch in a0, null
  278.                                         /// for error.
  279. #define umFreeEasyPatch 0x0000001f      /// Remove east patch in a0.
  280. #define umNoFree        0x80000000      /// Don't free memory after
  281.                                         /// processing
  282.  
  283. #define umLibExec       0x00000001
  284. #define umLibDOS        0x00000002
  285. #define umLibIntuition  0x00000003
  286. #define umLibGadTools   0x00000004
  287. #define umLibUtility    0x00000005
  288. #define umLibCommodities 0x0000006
  289. #define umLibIcon       0x00000007
  290. #define umLibReqTools   0x00000008
  291. #define umLibLayers     0x00000009
  292. #define umLibGraphics   0x0000000a
  293. #define umLibWorkbench  0x0000000b
  294.  
  295. #define umTagNeedVer            0x80000001
  296. #define umTagPatcherName        0x80000002
  297. #define umTagCoderName          0x80000003
  298. #define umTagPatcherIDString    0x80000004
  299. #define umTagPatcherDisableable 0x80000005
  300. #define umTagPatcherPrefs       0x80000006
  301. #define umTagPatcherNoRemove    0x8000001b
  302. #define umTagNeedVersion        0x80000007
  303. #define umTagVersion            0x80000008
  304. #define umTagInit               0x80000009
  305. #define umTagExit               0x8000000a
  306. #define umTagPrefs              0x8000000b
  307. #define umTagPrefsKey           0x8000000c
  308. #define umTagResourceType       0x8000000d
  309. #define umTagResourceName       0x8000000e
  310. #define umTagResourceVersion    0x8000000f
  311. #define umTagResourceID         0x80000010
  312. #define umTagPatchPri           0x80000011
  313. #define umTagPatchPurposeString 0x80000012
  314. #define umTagPatchIDString      0x80000013
  315. #define umTagPatchOffset        0x80000014
  316. #define umTagPatchDisableable   0x80000015
  317. #define umTagPatchFullPatch     0x80000016
  318. #define umTagPatch              0x80000017
  319. #define umTagPatchNotifyDisable 0x80000018
  320. #define umTagPatchInit          0x80000019
  321. #define umTagPatchExit          0x8000001a      /// 1b is last
  322.  
  323.  
  324. /**
  325. ***  Patchers list
  326. **/
  327.  
  328. struct psl {
  329.   struct MinNode
  330.               node;                     /// simple node structure
  331.   BPTR        psl_Segment;              /// BPTR to patcher segment
  332.   struct pfs *psl_Patcher;              /// pointer to patcher structure
  333. };
  334.  
  335.  
  336. /**
  337. ***  Patch link structure
  338. **/
  339.  
  340. struct pls {
  341.   struct pls *pls_Next;                 /// pointer to next link
  342.   struct pls *pls_Prev;                 /// pointer to prev link
  343.   APTR        pls_LinkIDString;         /// listview string
  344.   APTR        pls_Prefs;                /// pointer to prefs routine
  345.   LONG        pls_Flags;                /// flags
  346.   LONG        pls_Status;               /// status
  347.   struct mps *pls_List[1000];           /// patches
  348. }
  349.  
  350. #define plsPrefs       0x00000001
  351. #define plsDisableable 0x00000002
  352. #define plsDisTemp     0x00000004       /// While removed, previous status
  353.  
  354. #endif  /* UPS_H */
  355.  
  356.